/**
 * 
 */
package com.jm.web.tags;

import com.jm.web.tags.support.DataSourceTag;

/**
 * @author yanjie
 *
 * 2011/10/17 上午11:19:32
 */
public class BaseDPTag extends DataSourceTag{
	private static final long serialVersionUID = -6062782452718176086L;

	private static final String TAG_TABSIZE = "tabsize";
	private static final String TAG_CUSTOMTAB = "customtab";
	
	protected int iTabSize = 1;
	protected int currentTabIndex = 0;
	protected String customtab = ""; 
	
	public int getTabSize() {
		return iTabSize;
	}

	public void setTabSize(int iTabSize) {
		if(iTabSize > 2)
			iTabSize = 2 ;
		
		this.iTabSize = iTabSize;
	}
	
	public int getCurrentTabIndex() {
		return currentTabIndex;
	}
	
	public void addCurrentTabIndex(){
		this.currentTabIndex ++ ;
	}
	
	@Override
	public void clear() {
		iTabSize = 1 ;
		currentTabIndex = 0 ;
		customtab = "";
		super.clear();
	}

	public String getCustomtab() {
		return customtab;
	}

	public void setCustomtab(String customtab) {
		this.customtab = customtab;
	}
	
	public void setBorder(String strValue) {
		this.SetExtValue("border",strValue);
	}
	
	public void setWidth(String strValue) {
		this.SetExtValue("width",strValue);
	}
	
	public void setAlign(String strValue) {
		this.SetExtValue("align",strValue);
	}
	
	public void setLayout(String strValue) {
		this.SetExtValue("layout",strValue);
	}
	
	public void setKeydownConfig(String strValue){
		this.SetExtValue("keydownconfig",strValue);
	}
	
	public void setStyle(String strValue) {
		this.SetExtValue("style",strValue);
	}
	
	public void setCache(String strValue) {
		this.SetExtValue("cache",strValue);
	}
	
	public void setHideTabs(String strValue) {
		this.SetExtValue("hideTabs",strValue);
	}
	
	public boolean isHiddeTab(String tabid){
		String hideTabs = ","+this.GetExtValue("hideTabs", "")+",";
		return hideTabs.indexOf(","+tabid+",")>=0;
	}
}
